package com.smartEdu.service.impl.app;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import com.smartEdu.commons.CMap;
import com.smartEdu.commons.LogCvt;
import com.smartEdu.commons.Session;
import com.smartEdu.commons.Tag_Tips;
import com.smartEdu.dao.RecommendFriendDao;
import com.smartEdu.exception.JedisException;
import com.smartEdu.exception.JsonException;
import com.smartEdu.exception.RsaExeption;
import com.smartEdu.model.CourseCategoryModel;
import com.smartEdu.model.HomeWorkModel;
import com.smartEdu.model.HomeWorkModel2;
import com.smartEdu.model.RecommendFriendModel;
import com.smartEdu.model.RongCloudModel;
import com.smartEdu.model.UserStudentParamModel;
import com.smartEdu.service.RecommendFriendServie;
import com.smartEdu.utils.JsonUtil;
import com.smartEdu.utils.RsaUtil;
@Service(value="recommendfriendserviceimpl")
public class RecommendFriendServiceImpl extends BaseServiceImpl implements RecommendFriendServie{

	@Autowired
	@Qualifier(value="recommendfrienddaoimpl")
	private RecommendFriendDao recommendfrienddao;
	
	
	@Override
	public void recommend(Session sess) {
		// TODO Auto-generated method stub

		List<RecommendFriendModel> models=null;
		CMap map=null;
		try{
			map=SetToMap(sess);
            models=recommendfrienddao.getRecommendFriend();
            sess.put("recommendfriend", models);
			sess.put(Tag_Tips.RESPCODE,Tag_Tips.OK);
			
		}catch(JsonException e){
			LogCvt.error("json格式异常",e);
			sess.put(Tag_Tips.RESPCODE, "2");
		}catch (Exception e) {
			LogCvt.error("系统异常",e);
			sess.put(Tag_Tips.RESPCODE, "1");
		}finally{
			map=null;
		}	
	}

}
